#!/usr/bin/python

import subprocess
import re

groups = { "drawable-hdpi":1.5, "drawable-xhdpi":2.0, "drawable-mdpi":1.0, "drawable-ldpi":0.75 }

file="ic_launcher.svg"
baseline = groups["drawable-ldpi"]
for k in groups.keys():
    scale = groups[k] / baseline
    x = int(48 * scale)
    y = int(48 * scale)
    size = "{0},{1}".format(x,y)
    out = "../res/{0}/{1}".format(k,file)
    out = re.sub(".svg", ".png", out)
    print "{0} -> {1} -> {2}".format(file, size, out)
    convert = subprocess.Popen(['/usr/bin/convert', file, '-size', size, "-transparent", "#00ff00", out], shell=False)
    convert.wait()

#convert ic_launcher.svg -size 48x48 ../drawable-ldpi/ic_launcher.png
#
#drawable-hdpi
#drawable-mdpi
#drawable-xhdpi
#layout
#menu
#svg
#values
#values-v11
#values-v14
